﻿<!--#include file="utf-8.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="config.asp" -->
<!--#include file="md5.asp"-->

<html>
<head>
<title>网站后台管理系统</title>
<link href="images/style.css" rel="stylesheet" type="text/css">
<style>
body {background:#016ba9;text-align:center;}
.textbox {background:#000;width:100px;color:#fff;border:#7dbdd9 1px solid;}
.textbox1 {background:#000;width:100px;color:#fff;border:#7dbdd9 1px solid;}
</style>
</head>
<body>
<div class="login">
<form  name="add" method="post" action="index.asp?login=ok" >
<div style="padding-top:100px;">  <br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

<table width="350" height="74" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="25">用户帐号</td>
    <td height="25"><input name="admin" type="text" class="textbox1" size="17" /></td>
    <td height="25">用户密码</td>
    <td height="25"><input name="password" type="password" class="textbox1" size="19" /></td>
  </tr>
  <tr>
    <td height="25">验证码</td>
    <td height="25"><input class="textbox1" name="VerifyCode" type="text" size="17" /></td>
    <td height="25"><input border="0" cache="cache" src="images/login_button.jpg"type="image" name="image" /></td>
    <td height="25">&nbsp;</td>
  </tr>
  <tr>
    <td height="25">&nbsp;</td>
    <td height="25"><img height="23" src="vCode.asp?" onClick="this.src+=Math.random()" f alt="图片看不清？点击重新得到验证码" style="cursor:hand;" /></td>
    <td height="25">&nbsp;</td>
    <td height="25">&nbsp;</td>
  </tr>
</table>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</div>
</form>
</div>
</body>
</html>



<% 

if Request.QueryString("login")="ok" then

admin=request.form("admin")
password=md5(Request("password"))
VerifyCode=request.form("VerifyCode") 
if admin=""  then 
response.Write("<script language=javascript>alert('用户名不能为空!');history.go(-1)</script>") 
response.end
end if 

if  password="" then 
response.Write("<script language=javascript>alert('密码不能为空!');history.go(-1)</script>") 
response.end
end if 

if cstr(Session("GetCode"))<>cstr(Request.Form("VerifyCode")) then
'response.Write("<script language=javascript>alert('验证码错误!');history.go(-1)</script>")
'response.End
end if

sql="select * from admin where admin='"&admin&"' and password='"&password&"'" 
set rs=conn.execute(sql) 
if rs.eof or rs.bof then 
	response.write "<script language=javascript>"
	response.write "alert('帐号密码错误，请重新输入!');"
	response.write "javascript:history.go(-1);"
	response.write "</script>" 
else 
	session("admin")=admin 
	Response.Cookies("admin")=admin
	session.Timeout = "60"
	response.redirect "admin_index.asp" 
end if 

end if
%> 